package com.app.controller;

import com.app.conf.RedisService;
import com.app.services.LogonService;
import com.app.util.Result;
import com.google.code.kaptcha.Producer;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Controller
@RestController
@Data
public class LogonController {
    @Autowired
    private LogonService logonService;

    @PostMapping("logon")
    public Result logon(@RequestParam("mobile") String mobile,
                        @RequestParam("code") String code,
                        @RequestParam("type") Integer type) {
        Result result = logonService.logon(mobile, code, type);
        return Result.success(result);
    }
}
